package com.example.provider.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yangjianrong
 * @date 2020/7/3 14:35
 **/
@RestController
public class TestController {
    @Value("${server.port}")
    String port;

    @Value("${spring.application.name}")
    String name;
    @Value("${kd.app.name}")
    String appName;

    @RequestMapping("/test")
    public String test() throws InterruptedException {
        int a=1/0;// 除数不能为0
      //  Thread.sleep(120000L);
        return appName+"上线测试:"+name+":"+port;
    }

    @RequestMapping("/test1")
    public String test1() {
        return "66666666666";
    }

    @RequestMapping(value = "/testone")
    public String testOne(@RequestParam String msg){
        int a=1/0;// 除数不能为0
        return "你好啊！"+ msg + appName+"上线测试:"+name+":"+port;
    }

}
